﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data.Odbc;
using System.Data.OleDb;
using System.Configuration;
/// <summary>
/// Summary description for GetSlotDetails
/// </summary>
public class GetSlotDetails
{
    public GetSlotDetails()
    {

    }

    public int MgetSlotDetails(int x)
    {
        String CS = ConfigurationManager.ConnectionStrings["myDBConnection"].ConnectionString;
        using (SqlConnection myConnection = new SqlConnection(CS))
        {
            myConnection.Open();
            string getSlotStatus = "select BookingStatus from parkingSlot where SlotNo = '" + x + "'";
            SqlCommand command = new SqlCommand(getSlotStatus, myConnection);
            int slotbooked = Convert.ToInt32(command.ExecuteScalar().ToString());
            myConnection.Close();
            return slotbooked;

            
        }
    }
	
}